package com.atguigu.eduorder.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Author zhaolie
 * @Date 2020/12/18 10:06 上午
 * @Version 1.0
 * @Description
 */

@Component
public class ConstantPropertiesUtils implements InitializingBean {

    @Value("${wx.pay.app_id}")
    private String appId;

    @Value("${wx.pay.mch_id}")
    private String mchId;

    @Value("${wx.pay.partnerkey}")
    private String partnerKey;


    // 定义公开静态常量
    public static String APP_ID;
    public static String MCH_ID;
    public static String PARTNER_KEY;


    @Override
    public void afterPropertiesSet() throws Exception {
        APP_ID = appId;
        MCH_ID = mchId;
        PARTNER_KEY = partnerKey;
    }
}
